﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelLayer;
using DBLayer;

namespace CtrLayer
{
    public class SaleController
    {
        ISaleDB saleDb = new SaleDBClient();

        public Sale CreateSale(decimal price, Show show, Person person, bool payed, DateTime paymentDate, int seatsReserved)
        {
            return new Sale(price, show, person, payed, paymentDate, seatsReserved);
        }

        public void InsertSale(Sale s)
        {
            saleDb.InsertSale(s);
        }

        public Sale GetSale(int id)
        {
            return saleDb.GetSale(id);
        }

        public int DeleteSale(int id)
        {
            return saleDb.DeleteSale(id);
        }

        public int UpdateSale(Sale s)
        {
            return saleDb.UpdateSale(s);
        }

        public List<Sale> GetUnpaidSale(string telephone)
        {
            return saleDb.GetUnpaidSales(telephone);
        }

        public List<Sale> GetSalesByShow(Show s)
        {
            return saleDb.GetSalesByShow(s);
        }
    }
}
